Skip to content

Avoid sensitive user context in WTA logs#261

Merged
vanzue merged 13 commits into
mainfrom
dev/vanzue/log-cwd-trace-only
Jun 11, 2026
Merged

Avoid sensitive user context in WTA logs#261
vanzue merged 13 commits into
mainfrom
dev/vanzue/log-cwd-trace-only

Conversation

@vanzue

@vanzue vanzue commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Audit and fix WTA logs that emitted sensitive user context at default/user-facing diagnostic levels where it was not useful. Debug/probe diagnostics are intentionally out of scope.

Findings & fixes

Default-level cwd / workspace context. run_delegate, acp_load_session (boot-time + inbound), agents_view resume dispatch, and master new_session no longer record cwd at info! / warn!.

Default-level user content / arbitrary files. master forwards fs/read_text_file / fs/write_text_file and terminal creation requests without logging the file path, command, or command args. Session-title upgrade logs keep only a character count, not the title text.

Master pipe discovery diagnostics. The full discovery-file path is not logged, but logs include stable non-user hints: discovery_file="master-pipe.txt" and pipe_name.

Hook installer left unchanged. agent_hooks_installer.rs is restored to origin/main because hook install/upgrade diagnostics rely on concrete paths for stale marketplace and WindowsApps staging issues.

Out of scope

  • Debug/probe logs, including session hook debug payloads and startup probe details.
  • Hook installer logging, intentionally left as-is.
  • err / error Display fields — diagnostic and essential; not reliably sensitive user context.
  • Existing low-level protocol/event content logs outside this audit area, such as ACP wire trace or WT event dumps.

Verification

cargo build --manifest-path tools/wta/Cargo.toml passes.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot AI review requested due to automatic review settings June 10, 2026 02:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts WTA delegate logging in tools/wta to avoid emitting the current working directory (cwd) at default log levels, moving that path to the existing trace-gated delegate.content channel to reduce PII exposure in shipped (info) logs.

Changes:

  • In run_delegate, remove cwd from the info! log and include it only in the delegate.content trace! log.
  • In delegate_with_context, remove cwd from the debug! log (leaving cwd only in the delegate.content trace! log alongside the command line).

Comment thread tools/wta/src/main.rs Outdated
run_delegate logged cwd at info! level. cwd is a filesystem path carrying the Windows username and folder names, so it is personal data, yet info is the shipped release default. Move cwd onto the existing trace-only delegate.content channel so nothing personal lands in wta-delegate.log at the default filter; the info line keeps only prompt_chars and the agent command name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vanzue vanzue force-pushed the dev/vanzue/log-cwd-trace-only branch from 27e904d to 9fa16d7 Compare June 10, 2026 02:17
Addresses Copilot review on PR #261: the delegate path was not the only default-level cwd leak. run_delegate's acp_load_session, app.rs dispatch_resume / dispatch_resume_in_agent_pane (agents_view) and the inbound load_session handler, plus master's new_session, all emitted the full cwd path at info!/warn! — which the shipped info filter writes.

Each default-level line now logs has_cwd (a bool) instead of the path; the full cwd moves to a sibling trace! on the matching *.content target (delegate.content / acp_load_session.content / agents_view.content / master.content), consistent with the repo convention that user/agent content only lands at trace. debug!-level cwd logs (coordinator_log, acp_log_built_prompt) are left as-is since debug is dev-only and never the shipped default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 10, 2026 02:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Full sweep of info/warn/error logs for personal data (the previous commits only covered cwd). Three classes addressed:

Tier 1 (user content / arbitrary files): master forwards fs/read|write_text_file and the on-disk session title at info!. The agent-controlled file path and the title (often derived from the user's prompt) now log only length/op at info; the full value moves to the trace-only master.content / session_hook.content channel.

Tier 2 (fixed tool/runtime paths whose only PII is the Windows username): hooks-installer config/plugin/marketplace/bundle paths, the master-pipe discovery file, and the agent-pane origin record. New crate::logging::redact_user_path() rewrites the %LOCALAPPDATA%/%APPDATA%/%USERPROFILE% prefix to a placeholder, so these stay debuggable at info/warn without leaking the username.

Tier 3 (captured subprocess output): the plugin-CLI stdout/stderr/args move to the agent_hooks.content trace; only exe + exit status stay at default. wtcli stdout/stderr were reviewed and left as-is (tool diagnostics: pane GUIDs / protocol errors, no user content).

Out of scope: debug!-level logs (dev-only) and Tier 4 agent command lines (user-configured, not runtime PII). cargo build + logging unit tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vanzue vanzue force-pushed the dev/vanzue/log-cwd-trace-only branch from 90d04ee to ef54b3d Compare June 10, 2026 03:06
Copilot AI review requested due to automatic review settings June 10, 2026 03:06
@vanzue vanzue changed the title Keep delegate cwd path out of default-level logs Keep PII out of default-level WTA logs Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread tools/wta/src/logging.rs Outdated
vanzue and others added 2 commits June 11, 2026 14:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid replacing cwd paths with diagnostic has_cwd fields or trace-only cwd logs. Keep the operational log events but omit cwd entirely from logging.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread tools/wta/src/logging.rs Outdated
Comment thread tools/wta/src/master/mod.rs
vanzue added 2 commits June 11, 2026 15:16
Remove redact_user_path and stop logging fixed runtime/tool paths at default levels. Keep the operational log messages without path/source/staged/old/new fields.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use chars().count() for the title_len field so non-ASCII session titles are not reported as byte lengths.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 07:18
Stop moving sensitive paths, command lines, titles, and plugin CLI output into trace-only content logs. Keep the operational log events without those extra fields.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

tools/wta/src/agent_hooks_installer.rs:2160

  • Even with args moved onto the trace-only agent_hooks.content target here, run_plugin_cli_with_env still returns an error whose Display string includes args.join(" ") (lines 2165-2172). Callers log err = %e at warn! (e.g. Gemini install/update), and some args include filesystem paths (like bundle_path), so failures can still leak user-specific paths at default log levels. Consider removing args from the error message and relying on the existing trace logs for detailed arguments/output.
    Ok(())
}

/// Lower-cased substring search across the captured stdout+stderr for
/// any of `needles`. Returns true on the first hit. Lower-casing both
/// sides keeps the match case-insensitive without per-CLI normalization

@vanzue vanzue changed the title Keep PII out of default-level WTA logs Avoid sensitive user context in WTA logs Jun 11, 2026
Hook installation and upgrade flows rely on concrete filesystem paths for troubleshooting stale marketplace and staging issues, so keep those path fields in agent_hooks logs.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 08:00
Return tools/wta/src/agent_hooks_installer.rs to origin/main so this PR does not change hook installer diagnostics.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread tools/wta/src/main.rs
Comment thread tools/wta/src/master/mod.rs
Comment thread tools/wta/src/master/mod.rs
Comment thread tools/wta/src/master/mod.rs
Log the fixed discovery filename and pipe name around master pipe discovery file operations without including the user-specific filesystem path.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

vanzue added 2 commits June 11, 2026 16:42
Log safe SessionEvent summaries instead of full debug payloads so SessionStarted cwd/title do not appear in helper/master logs. Also strip user prompt template paths from prompt-source diagnostics and remove startup-probe cwd details.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 08:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@vanzue vanzue merged commit be2cca8 into main Jun 11, 2026
11 checks passed
@vanzue vanzue deleted the dev/vanzue/log-cwd-trace-only branch June 11, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants